using System;

namespace kk.messages.contracts.DataModel
{
    public class Vorstellung
    {
        public Vorstellung(string titel, DateTime termin, string saal) {
            Titel = titel;
            Termin = termin;
            Saal = saal;
        }

        public string Titel { get; private set; }

        public DateTime Termin { get; private set; }

        public string Saal { get; private set; }

        public bool Equals(Vorstellung other) {
            if (ReferenceEquals(null, other)) {
                return false;
            }
            if (ReferenceEquals(this, other)) {
                return true;
            }
            return Equals(other.Titel, Titel) && other.Termin.Equals(Termin) && Equals(other.Saal, Saal);
        }

        public override bool Equals(object obj) {
            if (ReferenceEquals(null, obj)) {
                return false;
            }
            if (ReferenceEquals(this, obj)) {
                return true;
            }
            if (obj.GetType() != typeof(Vorstellung)) {
                return false;
            }
            return Equals((Vorstellung)obj);
        }

        public override int GetHashCode() {
            unchecked {
                int result = (Titel != null ? Titel.GetHashCode() : 0);
                result = (result * 397) ^ Termin.GetHashCode();
                result = (result * 397) ^ (Saal != null ? Saal.GetHashCode() : 0);
                return result;
            }
        }
    }
}